Autogenerated HTML docs for v1.5.6.3-315-g10ce0
diff --git a/git-stash.html b/git-stash.html index 97aa37e..9e61785 100644 --- a/git-stash.html +++ b/git-stash.html
@@ -321,8 +321,11 @@ <h2>SYNOPSIS</h2> <div class="sectionbody"> <div class="verseblock"> -<div class="content"><em>git stash</em> (list | show [<stash>] | apply [<stash>] | clear | drop [<stash>] | pop [<stash>]) -<em>git stash</em> [save [<message>]]</div></div> +<div class="content"><em>git stash</em> list +<em>git stash</em> (show | apply | drop | pop ) [<stash>] +<em>git stash</em> branch <branchname> [<stash>] +<em>git stash</em> [save [<message>]] +<em>git stash</em> clear</div></div> </div> <h2 id="_description">DESCRIPTION</h2> <div class="sectionbody"> @@ -347,7 +350,7 @@ <div class="sectionbody"> <div class="vlist"><dl> <dt> -save [<message>] +save [--keep-index] [<message>] </dt> <dd> <p> @@ -356,6 +359,8 @@ subcommand is given. The <message> part is optional and gives the description along with the stashed state. </p> +<div class="para"><p>If the <tt>--keep-index</tt> option is used, all changes already added to the +index are left intact.</p></div> </dd> <dt> list [<options>] @@ -405,6 +410,23 @@ longer apply the changes as they were originally).</p></div> </dd> <dt> +branch <branchname> [<stash>] +</dt> +<dd> +<p> + Creates and checks out a new branch named <tt><branchname></tt> starting from + the commit at which the <tt><stash></tt> was originally created, applies the + changes recorded in <tt><stash></tt> to the new working tree and index, then + drops the <tt><stash></tt> if that completes successfully. When no <tt><stash></tt> + is given, applies the latest one. +</p> +<div class="para"><p>This is useful if the branch on which you ran <tt>git stash save</tt> has +changed enough that <tt>git stash apply</tt> fails due to conflicts. Since +the stash is applied on top of the commit that was HEAD at the time +<tt>git stash</tt> was run, it restores the originally stashed state with +no conflicts.</p></div> +</dd> +<dt> clear </dt> <dd> @@ -511,6 +533,28 @@ ... continue hacking ...</tt></pre> </div></div> </dd> +<dt> +Testing partial commits +</dt> +<dd> +<p> +You can use <tt>git stash save --keep-index</tt> when you want to make two or +more commits out of the changes in the work tree, and you want to test +each change before committing: +</p> +<div class="listingblock"> +<div class="content"> +<pre><tt>... hack hack hack ... +$ git add --patch foo # add just first part to the index +$ git stash save --keep-index # save all other changes to the stash +$ edit/build/test first part +$ git commit foo -m 'First part' # commit fully tested change +$ git stash pop # prepare to work on all other changes +... repeat above five steps until one commit remains ... +$ edit/build/test remaining parts +$ git commit foo -m 'Remaining parts'</tt></pre> +</div></div> +</dd> </dl></div> </div> <h2 id="_see_also">SEE ALSO</h2> @@ -530,7 +574,7 @@ </div> <div id="footer"> <div id="footer-text"> -Last updated 2008-07-06 05:17:03 UTC +Last updated 2008-07-14 03:12:31 UTC </div> </div> </body>